import { request } from 'ngfe-request'

// 费率列表查询
export async function getWithdrawalRataList(params: any) {
  return request('/list', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'FeeSVC',
        stdIntfcInd: 'list',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    },

  })
}

// 费率新增
export async function addWithdrawalRataInfo(params: any) {
  return request('/add', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'FeeSVC',
        stdIntfcInd: 'add',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    },
  })
}

// 费率类型
export async function listFeeCategoris(params: any) {
  return request('/listFee', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'FeeSVC',
        stdIntfcInd: 'listFeeCategoris',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    },
  })
}

// 生效
export async function activate(params: any) {
  console.log(params);
  return request('/activate', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'FeeSVC',
        stdIntfcInd: 'activate',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    },
  })
}

// 失效
export async function invalidation(params: any) {
  console.log(params);
  return request('/invalidation', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'FeeSVC',
        stdIntfcInd: 'invalidation',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    },
  })
}